<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>01-ref之字符串定义</title>
	<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
	<script src="http://static.web.sdo.com/chuanshi/common/react.development.js"></script>
	<script src="http://static.web.sdo.com/chuanshi/common/react-dom.development.js"></script>
	<script src="http://static.web.sdo.com/chuanshi/common/babel.min.js"></script>
	<script src="http://static.web.sdo.com/chuanshi/common/prop-types.js"></script>
</head>
<body>
	<div id="app" class="container" style="padding: 200px">
		
	</div>
</body>
</html>
<script type="text/babel">
	class App extends React.Component{
		getValue=()=>{
			const {value}=this.refs.textInput;
			console.log(value)
		}
		render(){
			return (
				<div className="form-group">
					<input ref="textInput" className="form-control" type="text" />
					<button onClick={this.getValue} className="mt-3 btn btn-primary">获取Input的值</button>
				</div>
			)
		}
	}
	ReactDOM.render(<App/>,document.getElementById('app'))
</script>